/*package com.example.monitoringsystem.util;

import com.example.monitoringsystem.bean.Administrator;
import com.example.monitoringsystem.bean.Doctor;
import com.example.monitoringsystem.bean.Patient;
import com.example.monitoringsystem.bean.User;
import org.springframework.security.core.context.SecurityContextHolder;


public class Util {
    public static User getCurrentUser() {
        User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return user;
    }
    public static Patient getCurrentPatient()
    {
        Patient patient=(Patient) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return  patient;
    }
    public  static Doctor getCurrntdoctor()
    {
Doctor doctor =(Doctor)  SecurityContextHolder.getContext().getAuthentication().getPrincipal();
return doctor;
    }
    public static Administrator getCurrentAdministrator()
    {
        Administrator administrator=(Administrator)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return  administrator;
    }

}*/
